/**
 * @author：刘东
 * @created: 2013-5-9 下午02:07:09 
 * @version：$Id$ 
 * @since:1.0
 * @copyright 
 *
 */

public class CompareArray {

	/**
	 * @param args
	 */
	public boolean isEqual(int[] arr1, int[] arr2) {

		if (arr1.length != arr2.length)
			return false;
		else {
			boolean flag1 = true;
			boolean flag2 = true;
			for (int i = 0; i < arr1.length; i++) {
				if (arr1[i] != arr2[i]) {
					flag1 = false;
				}
			}
			if (!flag1) {
				for (int i = 0; i < arr1.length; i++) {
					if (arr1[i] != arr2[arr1.length - 1 - i]) {
						flag2 = false;
					}
				}
			}

			return flag1 || flag2;
		}

	}

	public static void main(String[] args) {
		int arr1[] = {
			1, 2, 3, 4 };
		int arr2[] = {
			4, 3, 5, 1 };
		CompareArray compareArray=new CompareArray();
		System.out.println(compareArray.isEqual(arr1, arr2));

	}

}
